﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Licenta1.Statements
{
    class PenStatement:Statement
    {
        Expression width;

        public PenStatement(Context con, Expression e)
            : base(con)
        {
            width = e;
        }

        public override void Execute()
        {
            int w = 1;
            try
            {
                w = Convert.ToInt32(width.Value);
            }
            catch (Exception) { };
            if (w >= 1)
                context.activePen = new Pen(context.activeColor, w);
        }
    }
}
